#include <asm.h>
#include <csr.h>

ENTRY(setup_exception)
  /* TODO: 
   * save exception_handler_entry into STVEC
   * enable global exceptions */
   lui t1,%hi(exception_handler_entry)
   addi t1,t1,%lo(exception_handler_entry)
   csrw stvec,t1
   addi t1,zero,0x333
   csrw sie,t1
   addi t1,zero,0x22
   csrw CSR_SSTATUS,t1
   jr ra
ENDPROC(setup_exception)
